package io.renren.service;

import com.baomidou.mybatisplus.extension.service.IService;
import io.renren.common.utils.PageUtils;
import io.renren.common.utils.R;
import io.renren.entity.ApplicationEntity;

import java.util.Date;
import java.util.List;
import java.util.Map;
import java.util.Set;

/**
 * 会议室申请记录
 *
 * @author 1
 * @email 1@2.com
 * @date 2021-08-19 11:56:03
 */
public interface ApplicationService extends IService<ApplicationEntity> {

    PageUtils queryPage(Map<String, Object> params);

    List<ApplicationEntity> queryByRoomId(Long roomId);

    List<ApplicationEntity> queryByRoomIdAndState(Long roomId, String state);

    List<ApplicationEntity> queryByRoomIdAndStateOrderByIdDescLimit(Long roomId, String state, int limit);

    List<ApplicationEntity> queryByRoomIdAndSubject(Long roomId, String subject);

    Map<String, String> queryBookedTimeByRoomId(Long roomId);

    List<Long> queryBookedRoomIds(String bookDate, String startTime, String endTime);

    List<ApplicationEntity> queryUnfinish(Long id);

    boolean save(ApplicationEntity applicationEntity);

    List<ApplicationEntity> queryByIds(Set<Long> ids);

    R cancel(Set<Long> meetingIds);

    List<ApplicationEntity> queryNextMeeting(Long roomId, Date startTime);
}

